/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.service;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.fee.entity.PayInvoiceDetail;
import com.jeeplus.modules.fee.mapper.PayInvoiceDetailMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 应收发票明细表Service
 * @author weisong
 * @version 2017-09-19
 */
@Service
@Transactional(readOnly = true)
public class PayInvoiceDetailService extends CrudService<PayInvoiceDetailMapper, PayInvoiceDetail> {

	public PayInvoiceDetail get(String id) {
		return super.get(id);
	}
	
	public List<PayInvoiceDetail> findList(PayInvoiceDetail payInvoiceDetail) {
		return super.findList(payInvoiceDetail);
	}
	
	public Page<PayInvoiceDetail> findPage(Page<PayInvoiceDetail> page, PayInvoiceDetail payInvoiceDetail) {
		return super.findPage(page, payInvoiceDetail);
	}
	
	@Transactional(readOnly = false)
	public void save(PayInvoiceDetail payInvoiceDetail) {
		super.save(payInvoiceDetail);
	}
	
	@Transactional(readOnly = false)
	public void delete(PayInvoiceDetail payInvoiceDetail) {
		super.delete(payInvoiceDetail);
	}

	// 关联发票明细表
	public List<PayInvoiceDetail> findPayInvoiceDetailById(String id) {
		return mapper.findPayInvoiceDetailById(id);
	}

	// 回填应付账款的开票金额
	public List<PayInvoiceDetail> findPayInvoiceMoney(String id){
		return mapper.findPayInvoiceMoney(id);
	}

	//根据结算单id和发票id获取发票子表
	public PayInvoiceDetail findAllByPayableId(String ableId ,String invoiceId ){
		return mapper.findAllByPayableId(ableId, invoiceId);
	}
}